﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Text;

namespace Ewts.ashx
{
    /// <summary>
    /// Summary description for HWInput
    /// </summary>
    public class HWInput : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DataTable dt = new DataLib.BLL.Rubbish().GetAllList().Tables[0];
            StringBuilder items = new StringBuilder();
            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    items.Append(dt.Rows[i]["itemCode"].ToString());
                    items.Append("@");
                    items.Append(dt.Rows[i]["itemName"].ToString());
                    items.Append("@");
                    items.Append(dt.Rows[i]["id"].ToString());
                    items.Append("\n");
                }
            }
            context.Response.Write(items.ToString());
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}